resetStudentPassword = function(){
	Ext.define('studentModel',{
		extend:'Ext.data.Model',
		fields:[ 
		        	{name:'id',type:'String'},
		        	{name:'studentId',type:'String'},
		        	{name:'studentName',type:'string'},
		        	{name:'sex',type:'string'},
		        	{name:'grade',type:'String'},
			        {name:'academy',type:'string'},
			        {name:'professional',type:'string'},
			        {name:'inclass',type:'string'},
			        {name:'counselor',type:'string'},
			        {name:'national',type:'string'},
			        {name:'politicalStatus',type:'string'}
			       ],
		idProperty : 'studentId'
	});
	

	var store = Ext.create('Ext.data.Store',{
		pageSize:10,
		model:studentModel,
		autoLoad:true,
		proxy:{
			type:'ajax',
			url:'searchAllStudentListPageAction.action',
			reader:{
				type:'json',
				root:'resultList.list',
				totalProperty:'resultList.total'
			}
		}
	});
	

	var grid = Ext.create('Ext.grid.Panel',{
		store:store,	
		columnLines:true,
		//selModel:checkBox,
		disableSelection:false,
		//width:600,
		loadMask:true,
		
		columns:[
		         {text:'学号',width:100,dataIndex:'studentId',sortable:true},
		         {text:'姓名',width:100,dataIndex:'studentName',sortable:true},
		         {text:'性别',width:50,dataIndex:'sex',sortable:true},
		         {text:'民族',width:100,dataIndex:'national',sortable:true},
		         {text:'政治面貌',width:100,dataIndex:'politicalStatus'},
		         {text:'年级',width:80,dataIndex:'grade',sortable:true},
		         {text:"学院",width:100,dataIndex:'academy',sortable:true,},
		         {text:"专业",width:150,dataIndex:'professional',sortable:true},
		         {text:'班级',width:100,dataIndex:'inclass',sortable:true},
		         {text:'辅导员',width:80,dataIndex:'counselor',sortable:true},
		         ],
		autoHeight:true,
		authWidth:true,

		title:"学生列表",
		loadMask:true,
		pageSize:5,
		dockedItems:[{
			dock:'top',
			xtype:'toolbar',
			
			items:[{
				width:300,
				fieldLabel:'搜索',
				labelWidth:70,
				xtype:'searchfield',
				store:store			
			},{
				xtype:'label',
				html:'<div style="font-size:12px;color:red">*支持姓名和学号的模糊查询，双击进入密码重置(重置后，密码为学生学号)</div>'
			}]		
		},
		{
			dock:'bottom',
			xtype:'pagingtoolbar',	
			store:store,
			displayInfo:true,
			displayMsg:'显示{0}-{1}条，共计{2}条',
			emptyMsg:"没有数据"
		}],
		listeners:{  

			//双击事件
			itemdblclick : function( grid, record, item, index, e, eOpts){  
				var selectedKeys = grid.getSelectionModel().getSelection();
				resetStudentPassword(selectedKeys[0]);
			       }  
		}
	});
	
	function resetStudentPassword(data){
		Ext.MessageBox.confirm('提示', '确定重置学生：'+data.get('studentName')+'('+data.get('studentId')+')'+'的密码吗？', function(btn){
			if(btn == 'yes'){
				var studentId = data.get('studentId');
				Ext.Ajax.request({  
			        url : "resetStudentPasswordAction.action",  
			        params : {  
			        	studentId:studentId
			        	
			        },  
			        method : 'POST',  
			        success : function(response, opts) {  
			            var success = Ext.decode(response.responseText).success;  
			            // 当后台数据同步成功时  
			            if (success) {  
			            	Ext.Msg.alert("提示","密码重置成功！");
			            	Ext.getCmp('editSummaryId').close();
			            } else {  
			            	Ext.Msg.alert("提示",Ext.decode(response.responseText).msg);
			            }  
			        }  
			        
			    });  
			}
		}); 
		
	}
	
	
	return grid;
	
	
}